﻿using RepositoryDefinition;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForumBL
{
    public class AnswerBL
    {
        private IAnswerRepository answerContext;

        public AnswerBL()
        {
            answerContext = IOC.Factory.GetRepository().GetAnswerRepository();
        }

        public List<ForumDomainModels.Answer> GetAnswersToPost(ForumDomainModels.Post post)
        {
            List<ForumDomainModels.Answer> answersToPost = 
                answerContext.GetAnswersByPost(post);
            return answersToPost;
        }

        public void InsertAnswer(ForumDomainModels.Answer answer)
        {
            answerContext.InsertAnswer(answer);
        }
    }
}
